/***************************************************************************
 *   Copyright (C) 2010 by Lasse Liehu                                     *
 *   lliehu@kolumbus.fi                                                    *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef NOTIFIERSETTINGS_H
#define NOTIFIERSETTINGS_H

#include <QObject>
class QFont;

#include "newunreaditemsnotificationtime_enum.h"

class NotifierSettingsPrivate;

class GoogleLoginData;

/**
 * Note that checking interval is in minutes.
 */
class NotifierSettings : public QObject
{
    Q_OBJECT

    public:
        explicit NotifierSettings(bool readSettingsAtConstruction = false);
        ~NotifierSettings();

        GoogleLoginData& loginData();
        const GoogleLoginData& loginData() const;

        int checkingInterval() const;
        QFont unreadCountDisplayFont() const;
        bool isUnreadCountShownInWindow() const;
        NewUnreadItemsNotificationTime notificationTime() const;
        bool isAutostartEnabled() const;

        int defCheckingInterval() const;
        QFont defUnreadCountDisplayFont() const;
        bool defIsUnreadCountShownInWindow() const;
        NewUnreadItemsNotificationTime defNotificationTime() const;
        bool defIsAutostartEnabled() const;
    signals:
        void settingsRead();
        void checkingIntervalChanged();
        void unreadCountDisplayFontChanged();
        void isUnreadCountShownInWindowChanged();
        void notificationTimeChanged();
        void isAutostartEnabledChanged();
    public slots:
        void setCheckingInterval(int);
        void setUnreadCountDisplayFont(const QFont&);
        void setShowUnreadCountInWindow(bool);
        void setNotificationTime(NewUnreadItemsNotificationTime);
        void setAutostartEnabled(bool);

        void setToDefaults();
        void readSettings();
        void writeSettings();
    private:
        NotifierSettingsPrivate *const d;
};

#endif
